<template>

  <div>
    <el-container style="height: 700px; border: 1px solid #eee;">
      <el-aside width="15%" style="background-color: rgb(238, 241, 246)" v-if="$store.state.roleId != 0">
        <el-menu style="background-color: #2c3e50;height: 100%;">
          <el-submenu v-if="$store.state.roleId >= 1 && $store.state.roleId <= 3">
            <template slot="title" ><i class="el-icon-user-solid"></i>
              <router-link :to="{name:'StudentInfo'}"style="color: white;text-decoration:none;">学生信息管理</router-link>
            </template>
          </el-submenu>
          <el-submenu v-if="$store.state.roleId == 1 || $store.state.roleId == 6 || $store.state.roleId == 4">
            <template slot="title"><i class="el-icon-s-platform"></i>
              <router-link :to="{name:'Consultant'}"style="color: white;text-decoration:none">前台咨询信息</router-link>
            </template>
          </el-submenu>
          <el-submenu v-if="$store.state.roleId >= 1 && $store.state.roleId <= 3">
            <template slot="title"><i class="el-icon-user"></i>
              <router-link :to="{name:'Employment'}"style="color: white;text-decoration:none">学生就业信息</router-link>
            </template>
          </el-submenu>
          <el-submenu v-if="$store.state.roleId == 1 || $store.state.roleId == 5">
            <template slot="title"><i class="el-icon-s-data"></i>
              <router-link :to="{name:'Payment'}"style="color: white;text-decoration:none">财务缴费管理</router-link>
            </template>
          </el-submenu>
          <el-submenu v-if="$store.state.roleId == 1 || $store.state.roleId == 3">
            <template slot="title"><i class="el-icon-edit"></i>
              <router-link :to="{name:'Accommodation'}"style="color: white;text-decoration:none">住宿信息管理</router-link>
            </template>
          </el-submenu>
          <el-submenu v-if="$store.state.roleId >= 1 && $store.state.roleId <= 3">
            <template slot="title"><i class="el-icon-s-order"></i>
              <router-link :to="{name:'Classes'}"style="color: white;text-decoration:none">班级信息管理</router-link>
            </template>
          </el-submenu>
          <el-submenu v-if="$store.state.roleId == 1">
            <template slot="title"><i class="el-icon-s-custom"></i>
              <router-link :to="{name:'Employee'}"style="color: white;text-decoration:none">员工信息管理</router-link>
            </template>
          </el-submenu>
          <el-submenu v-if="$store.state.roleId == 1 || $store.state.roleId == 5">
            <template slot="title"><i class="el-icon-document"></i>
              <router-link :to="{name:'PaymentType'}"style="color: white;text-decoration:none">缴费项目信息</router-link>
            </template>
          </el-submenu>
          <el-submenu v-if="$store.state.roleId >= 1 && $store.state.roleId <= 3">
            <template slot="title"><i class="el-icon-edit-outline"></i>
              <router-link :to="{name:'StudentScoreInfo'}" style="color: white;text-decoration:none">学生成绩登记</router-link>
            </template>
          </el-submenu>
        </el-menu>
      </el-aside>
      <div style="width: 85%;">
      <router-view></router-view>
      </div>
    </el-container>
  </div>
</template>

<script>

export default {
  name: 'Index',
  data () {
    return {
    }
  },
  methods: {
  },
  created(){
    if (this.$store.state.roleId == 0){
      this.$message('请先登录');
      this.$router.push({name:'Login'});
    }
  }
}
</script>

<style scoped>
a {
  color: #42b983;
}

</style>
